<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate,fileupload"/>
<sys:header title="会员管理 - ${member.isNewRecord ? '新增' : '编辑'}会员" extLibs="${extLibs}" htmlClass="scroll"/>
<link href="${ctxStatic}/common/css/form.css" rel="stylesheet" type="text/css">
<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="member" action="${ctx}/mdm/member/save" method="post" class="form-horizontal">
				<div class="tool">
					<input id="btnSubmit" type="button" value="保存" class="tool1">
					<input id="btnCancel" type="button" value="关闭" class="tool1" onclick="closeCurrentTabPage('${param.parentTabPageId}')">
				</div>
				<div class="biaodan_bg">
					<div class="biaodan">
							<table width="100%" border="0" class="tb2">
							    <tr>
							          <td colspan="7" align="center"  ><strong style="font-size:24px; font-weight:normal;">${fns:getConfig('university')}工会会员申请表</strong></td>
							    </tr>
							</table>
							<table width="100%" border="0" class="tb4">
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">工号</td>
								<td width="120">
									<form:hidden path="isNewRecord"/>
									<form:input path="memberCode" htmlEscape="false" maxlength="64" readonly="${!member.isNewRecord}" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">姓名</td>
								<td width="120">
									<form:input path="memberName" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">性别</td>
								<td width="120">
									<form:select path="sex" multiple="false" class="form-control required input-sm"  >
										<form:options items="${fns:getDictList('sex')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
									</form:select>
								</td>
								<td  rowspan="6">
									<div style="width:120px;height:150px;margin:0px auto;">
										<sys:fileupload id="file" bizCategory="mdm_member" bizKey="${member.memberCode}" 
										 uploadType="image" maxUploadNum="1" isMini="true" imageStyle="width:100px;height:120px;"/>
									</div>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">籍贯</td>
								<td>
									<form:input path="nativePlace" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">民族</td>
								<td>
									<form:select path="nation" multiple="false" class="form-control required input-sm"  >
										<form:option value="">请选择</form:option>
										<form:options items="${fns:getDictList('nation')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
									</form:select>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">政治面貌：</td>
								<td>
									<form:input path="partisan" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">学历</td>
								<td>
									<form:input path="education" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">出生日期</td>
								<td>
									<input name="birthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
											value="<fmt:formatDate value="${member.birthday}" pattern="yyyy-MM-dd"/>"
											onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">联系方式：</td>
								<td>
									<form:input path="phone" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
							</tr>
							<tr>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">身份证号</td>
								<td>
									<form:input path="idNo" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">身份类别</td>
								<td>
									<form:select path="idType" multiple="false" class="form-control required input-sm"  >
										<form:option value="">请选择</form:option>
										<form:options items="${fns:getDictList('id_type')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
									</form:select>
								</td>
								<td  width="100" class="text-center" bgcolor="#f5f5f5">所在校区：</td>
								<td>
									<form:select path="campus" multiple="false" class="form-control required input-sm"  >
										<form:option value="">请选择</form:option>
										<form:options items="${fns:getDictList('campus')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
									</form:select>
								</td>
							</tr>
							<tr>
								<td colspan="2" class="text-center" bgcolor="#f5f5f5">所在单位</td>
								<td colspan="2">
									<sys:treeselect id="officeCode" name="officeCode" value="${member.officeCode}" labelName="officeName" labelValue="${member.officeName}" 
							 			title="单位" url="/sys/office/treeData?isAll=true"   allowClear="true"/>
								</td>	
								<td class="text-center" bgcolor="#f5f5f5">职务/职称</td>
								<td >
									<form:select path="duty" multiple="false" class="form-control required input-sm"  >
										<form:options items="${fns:getDictList('duty')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
									</form:select>
								</td>	
							</tr>
							<tr>
								<td colspan="2" class="text-center" bgcolor="#f5f5f5">家庭住址</td>
								<td colspan="2">
									<form:input path="address" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>	
								<td class="text-center" bgcolor="#f5f5f5">邮编</td>
								<td >
									<form:input path="postCode" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>	
							</tr>
							
							<tr>
							    <td rowspan="7" class="text-center" bgcolor="#f5f5f5">成员</td>
								
							</tr>
							<tr>
								<td colspan="2" class="text-center" bgcolor="#f5f5f5">配偶姓名</td>
								<td colspan="2">
									<form:input path="spouseName" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>	
								<td class="text-center" bgcolor="#f5f5f5">出生年月</td>
								<td >
									<input name="spouseBirthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
											value="<fmt:formatDate value="${member.birthday}" pattern="yyyy-MM-dd"/>"
											onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>	
							</tr>
							<tr>
								<td colspan="2" class="text-center" bgcolor="#f5f5f5">工作单位</td>
								<td colspan="2">
									<form:input path="spouseWork" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>	
								<td class="text-center" bgcolor="#f5f5f5">职务/职称</td>
								<td >
									<form:input path="spouseDuty" htmlEscape="false" maxlength="64" class="form-control required"/>
								</td>	
							</tr>
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">子女姓名</td>
								<td class="text-center" bgcolor="#f5f5f5">性别</td>
								<td class="text-center" bgcolor="#f5f5f5">出生年月</td>
								<td class="text-center" colspan="3" bgcolor="#f5f5f5">就读学校/幼儿园或工作单位</td>
							</tr>
							<tr>
								<td><form:input path="childrenList[0].name" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td><form:input path="childrenList[0].sex" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td>
									<input name="childrenList[0].birthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
										value="<fmt:formatDate value="${childrenList[0].birthday}" pattern="yyyy-MM-dd"/>"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								<td colspan="3"><form:input path="childrenList[0].organization" htmlEscape="false" maxlength="64" class="form-control"/></td>
							</tr>
							<tr>
								<td><form:input path="childrenList[1].name" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td><form:input path="childrenList[1].sex" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td>
									<input name="childrenList[1].birthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
										value="<fmt:formatDate value="${childrenList[1].birthday}" pattern="yyyy-MM-dd"/>"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								<td colspan="3"><form:input path="childrenList[1].organization" htmlEscape="false" maxlength="64" class="form-control"/></td>
							</tr>
							<tr>
								<td><form:input path="childrenList[2].name" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td><form:input path="childrenList[2].sex" htmlEscape="false" maxlength="64" class="form-control"/></td>
								<td>
									<input name="childrenList[2].birthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
										value="<fmt:formatDate value="${member.childrenList[2].birthday}" pattern="yyyy-MM-dd"/>"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
								</td>
								<td colspan="3"><form:input path="childrenList[2].organization" htmlEscape="false" maxlength="64" class="form-control"/></td>
							</tr>
							
							<tr>
							    <td class="text-center" bgcolor="#f5f5f5">经历</td>
								<td colspan="6">
									<form:textarea path="remars" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm"/>
								</td>
							</tr>
							
						</table>
						<div class="hide">
							<input type="hidden" id="flowId" name="flowId"/>
							<sys:listselect id="approval" name="approvalCode" value="" labelName="approvalName" labelValue=""
								boxHeight="500"	boxWidth="450" returnCodeAttr="userCode" returnNameAttr="userName"	title="审批人" url="" multiple="true" cssClass="form-control"  />
						</div>
					</div>
			</div>
		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});
	
	$('#btnSubmit').click(function(){
		$("#inputForm").submit();
	});
</script>